package com.a2v2.online.store.common.asynch.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;

import com.a2v2.online.store.common.asynch.AsychService;
import com.a2v2.online.store.common.constant.ServiceConstant;
import com.a2v2.online.store.common.dto.BaseDTO;
import com.a2v2.online.store.helper.ServiceHelper;
import com.a2v2.online.store.service.contract.INotificationService;
import com.a2v2.online.store.service.dto.NotificationDTO;

public class NotificationAsynchServiceImpl implements AsychService {

	
	@Autowired
	INotificationService notificationService;
	
	@Override
	@Async
	public void executeTask(BaseDTO request) {
		notificationService = (INotificationService)ServiceHelper.getService(ServiceConstant.NOTIFICATION_SERVICE_NAME);
		if(notificationService!=null)
		{
			notificationService.sendNotification((NotificationDTO)request);
		}
	}

	@Override
	public void processReturn() {
		
		
	}

}
